package com.demo.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * GatewayAccountType
 * 
 * @author demo
 * @data 2020-12-14 11:23:27
 */
@Getter
@AllArgsConstructor
public enum GatewayAccountType {
    /** 管理员 */
    ADMIN("admin", "管理员"),
    /** 编辑 */
    EDITOR("editor", "编辑"),
    /** 访客 */
    GUEST("guest", "访客"),

    ;

    /**  */
    private String code;
    /**  */
    private String name;

    public static synchronized GatewayAccountType getByCode(String code) {
        for (GatewayAccountType e : GatewayAccountType.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

}
